From d82dd13c9e3462c2776dce7e0e94c0b6d8963ae8 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Tue, 14 Mar 2006 15:25:33 +0100 Subject: [PATCH] Fix PAE ptep_get_and_clear_full(). The fast path requires us to manually clear the low half before the high half. Otherwise the compiler may reorder the writes and validation in Xen will fail. From: Jan Beulich Signed-off-by: Keir Fraser --- .../include/asm-i386/mach-xen/asm/pgtable.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/pgtable.h b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/pgtable.h index 3a6f09c1cd..224c1032c7 100644 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/pgtable.h +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/pgtable.h @@ -272,7 +272,16 @@ static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long pte_t pte; if (full) { pte = *ptep; +#ifdef CONFIG_X86_PAE + /* Cannot do this in a single step, as the compiler may + issue the two stores in either order, but the hypervisor + must not see the high part before the low one. */ + ptep->pte_low = 0; + barrier(); + ptep->pte_high = 0; +#else *ptep = __pte(0); +#endif } else { pte = ptep_get_and_clear(mm, addr, ptep); } -- 2.30.2